from serpapi import GoogleSearch

def binsearch(query):
    params = {
        "engine": "bing",
        "q": query,
        "api_key": "65479047215896b2810dfd0bac6790af8da88a1140e7344019a8ab477b6e33a0",  # 请替换成你的SerpApi API密钥
    }

    search = GoogleSearch(params)
    results = search.get_dict()

    return results

if __name__ == "__main__":
    query = "今天北京的新闻有哪些"
    search_results = binsearch(query)
    print(search_results)
